package com.wuji.blog.utils;

import com.wuji.blog.pojo.dao.SysUser;

/**
 * @作者 wangj
 * @日期 2022/1/18 22:17
 * @描述 TODO
 **/
public class UserThreadLocal {
    private UserThreadLocal(){}
    //线程变量隔离
    private static final ThreadLocal<SysUser> LOCAL = new ThreadLocal<>();

    public static void put(SysUser sysUser){
        LOCAL.set(sysUser);
    }

    public static SysUser get(){
        return LOCAL.get();
    }

    public static void remove(){
        LOCAL.remove();
    }
}
